import 'package:flutter/material.dart';
import 'package:open_source_china/utils/DataUtils.dart';
import 'package:open_source_china/utils/EventBus.dart';

class SettingsPage extends StatefulWidget {
  @override
  _SettingsPageState createState() => _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  List list = [];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("设置"),
      ),
      body: Container(
          padding: EdgeInsets.all(15.0),
          child: ListView(
            children: [
              RaisedButton(
                  child: Text("退出登录"),
                  color: Colors.red[400],
                  onPressed: () {
                    DataUtils.logout().then((value) {
                      eventBus.fire(LogoutEvent());
                      Navigator.of(context).pop();
                    });
                  }),
            ],
          )),
    );
  }
}
